package com.zmn.oms.dubbo.interfaces.normal.order;

import com.zmn.common.dto2.ResponseDTO;
import com.zmn.oms.common.dio.normal.order.CheckOrderServiceDIO;
import com.zmn.oms.common.dio.normal.order.NormalOrderWorkAddDIO;
import com.zmn.oms.common.dio.normal.order.OrderWorkQuery;
import com.zmn.oms.dubbo.dto.zmn.order.NewOrderDRO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

import javax.validation.constraints.NotNull;
import java.util.Map;

/**
 * 类描述：普通单远程接口
 *
 * @author wangxiaokun
 * @since 2021/04/01 10:33
 */
@Api(
        value = "普通工单",
        tags = {"普通工单"}
)
public interface NormalOrderWorkRemoteService {

    /**
     * 查询工单信息
     * @see com.zmn.oms.model.entity.work.OrderWork
     * @see com.zmn.oms.model.entity.detail.OrderDetail
     * @see com.zmn.oms.model.entity.serviceitem.OrderServiceItem
     * 支持查询OrderWork、OrderDetail
     * 查询服务项，例如serviceItemList.number，返回参数key是serviceItemList，Object是number集合
     * @param orderWorkQuery
     * @return
     */
    @ApiOperation(value = "查询工单信息", response = ResponseDTO.class, tags = {"普通工单"})
    ResponseDTO<Map<String, Object>> getDynamicOrderWorkInfo(@NotNull(message = "动态查询工单数据不能为空") @ApiParam(value = "动态查询工单数据", required = true)
                                                      OrderWorkQuery orderWorkQuery);

    @ApiOperation(value = "新增普通工单", response = ResponseDTO.class, tags = {"普通工单"})
    ResponseDTO<NewOrderDRO> addOrder(@NotNull(message = "入参不能为空") @ApiParam(value = "入参", required = true)
                                 NormalOrderWorkAddDIO normalOrderWorkAddDIO);

    @ApiOperation(value = "检查服务能力", response = ResponseDTO.class, tags = {"普通工单"})
    ResponseDTO checkOrderServiceCapacity(@NotNull(message = "入参不能为空") @ApiParam(value = "入参", required = true)
                                                  CheckOrderServiceDIO checkOrderServiceDIO);
}
